package net.mingsoft.document.action.q;

import lombok.Data;
import net.mingsoft.basic.util.DateUtil;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @author gengfa
 * @date 22/01/25
 */
@Data
public class FileShareQuery {

    private String fileId;

    private List<Long> userIds;

    private String password;

    /**
     * true false
     */
    private boolean isAnnounced;

    /**
     * 通知类型 SYS 系统通知，EMAIL 电子邮件， SMS 短信
     */
    private List<String> announcementType;

    private String expiredDate;

    public boolean validate() {
        return StringUtils.isNotEmpty(expiredDate) && (DateUtil.equalR(expiredDate, DateUtil.nowDate()) || DateUtil.afterR(expiredDate, DateUtil.nowDate()));
    }
}
